<template lang="html">
  <div class="banner">
    <div class="swiper-size">
      <swiper :options="swiperOption">
        <swiper-slide v-for="(slide, index) in swiperSlides" :key="index">
          <img class="swiperimg" :src="slide" alt="">
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
export default {
  name:"Banner",
  data(){
    return{
      swiperSlides:[
        require("../assets/img/banner1.png"),
        require("../assets/img/banner2.png"),
        require("../assets/img/banner3.png"),
        require("../assets/img/banner4.png")
      ],
      // 轮播图配置
      swiperOption:{
        loop: true,
        autoplay: true,
        pagination: {
          el: '.swiper-pagination'
        },
        autoplay:{
          disableOnInteraction: false
        }
      }
    }
  },
  components:{

  }
}
</script>

<style lang="css" scoped>

.banner{
  width: 100%;
  height: 3.2rem;
  padding: 0.2rem;
  box-sizing: border-box;
}
.banner img{
  width: 100%;
}
.swiper-size, .swiper-container {
  height: 2.8rem;
}

</style>
